<?php
/**
 * @version		$Id: default.php 8 2011-12-23 15:25:34Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */
 
defined('_JEXEC') or die('Restricted Access');

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
JHtml::_('behavior.tooltip');
JHTML::_('script','system/multiselect.js',false,true);
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
?>
<form action="<?php echo JRoute::_('index.php?option=com_almhoster&view=hosting_accs'); ?>" method="post" name="adminForm">
	<fieldset id="filter-bar">	
		<div class="filter-search fltlft">
			<label class="filter-search-lbl" for="filter_search"><?php echo JText::_('Filter: '); ?></label>
			<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_ALMHOSTER_SEARCH_BY_HOSTING_ACC_NAME'); ?>" />
			<button type="submit"><?php echo JText::_('COM_ALMHOSTER_FILTER'); ?></button>
			<button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('COM_ALMHOSTER_RESET'); ?></button>
		</div>
		<div class="filter-select fltrt">
			<select name="filter_server_id" class="inputbox" onchange="this.form.submit()">
				<option value=""><?php echo JText::_('COM_ALMHOSTER_FILTER_BY_SERVER');?></option>
				<?php echo JHtml::_('select.options', $this->server, 'value', 'text', $this->state->get('filter.server_id'));?>
			</select>
		</div>			
	</fieldset>
<div class="clr"></div>
<table class="adminlist">
	<thead>
			<tr>
	<th width="5">
		<?php echo JHtml::_('grid.sort',  'Id', 'WhmaccId', $listDirn, $listOrder); ?>
	</th>
	<th width="10">
		<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->items); ?>);" />
	</th>
	<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_ORDER', 'order', $listDirn, $listOrder); ?>
	</th>		
	<th class="title">
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_DOMAIN', 'WhmaccDomain', $listDirn, $listOrder); ?>
	</th>
	<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_USER', 'WhmaccUser', $listDirn, $listOrder); ?>
	</th>
	<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_EMAIL', 'WhmaccEmail', $listDirn, $listOrder); ?>
	</th>
	<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_IP', 'WhmaccIp', $listDirn, $listOrder); ?>
	</th>
		<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_PLAN', 'WhmaccPlan', $listDirn, $listOrder); ?>
	</th>
	<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_SERVER', 'WhmaccServer', $listDirn, $listOrder); ?>
	</th>
	<th>
		<?php echo JHtml::_('grid.sort',  'COM_ALMHOSTER_ACCOUNT_STATUS', 'WhmaccStatus', $listDirn, $listOrder); ?>
	</th>
	</tr>
</thead>
<tfoot>	
	<tr>
	<td colspan="10">
		<?php echo $this->pagination->getListFooter(); ?></td>
	</tr>		
</tfoot>
<tbody>
	<?php foreach($this->items as $i => $item): 
?>
	<tr class="row<?php echo $i % 2; ?>">
		<td>
			<?php echo $item->WhmaccId; ?>
		</td>
		<td>
			<?php echo JHtml::_('grid.id', $i, $item->WhmaccId); ?>
		</td>
		<td>
			<?php echo $item->order_no,' - '.$item->order_prod; ?>
		</td>
		<td align="center">
		<a href="<?php echo JRoute::_('index.php?option=com_almhoster&task=hosting_acc.edit&WhmaccId=' . $item->WhmaccId); ?>">
				<?php echo $item->WhmaccDomain; ?>
				</a>
		</td>
		<td>
			<?php echo $item->WhmaccUser; ?>
		</td>
		<td>
			<?php echo $item->WhmaccEmail; ?>
		</td>
		<td align="center">
			<?php echo $item->WhmaccIp; ?>
		</td>
		<td>
			<?php echo $item->WhmaccPlan; ?>
		</td>
		<td align="center">
			<?php echo $item->server; ?>
		</td>
		<td align="center">
			<?php echo JText::_('COM_ALMHOSTER_WHM_ACC_STATUS_'.$item->WhmaccStatus); ?>
		</td>
	</tr>
<?php endforeach; ?>
</tbody>
	</table>
	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
		<?php echo JHtml::_('form.token'); ?>
	</div>
</form>
